﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Zhao.Common.Helper;
using Zhao.Models.AppletDto;
using Zhao.Models.DTO;
using Zhao.Models.Entity;

namespace Zhao.IServer.Field
{
    /// <summary>
    /// 场地
    /// </summary>
    public interface IFieldsServer : IBaseService<Fields>
    {
        /// <summary>
        /// 获取场地信息
        /// </summary>
        /// <param name="expressionable"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public Task<PageModel<FieldDto>> FieldsQuery(Expression<Func<Fields, Venues, FieldTypes, bool>> expressionable, int pageIndex, int pageSize);

        /// <summary>
        /// 获取球馆预约不同时间段的价格和场地预约信息
        /// </summary>
        /// <param name="expressionable">查询条件</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <param name="display">日期</param>
        /// <returns>分页的场地价格和预约信息</returns>
        public Task<PageModel<VenuePricingDTO>> SessionPriceQuery(Expression<Func<Venues, Fields, bool>> expressionable, int pageIndex, int pageSize, string display, int order);
        /// <summary>
        /// 更新已完成的场地预约状态
        /// </summary>
        /// <returns>更新的记录数</returns>
        public Task<int> UpdateCompletedAppointmentsAsync();

        #region 小程序api
        /// <summary>
        /// 获取球馆场地类型和未来一周价格
        /// </summary>
        /// <param name="venueId">球馆ID</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <returns>场地类型和价格信息</returns>
        public Task<PageModel<VenuesFieldsInfo>> GetVenueFieldsInfo(Guid venueId, int pageIndex, int pageSize);

        /// <summary>
        /// 获取场地不同时段价格（简化版）
        /// </summary>
        /// <param name="expressionable">查询条件</param>
        /// <param name="display">日期</param>
        /// <returns>场地价格和预约信息列表</returns>
        public Task<List<VenuePricingSimpleDTO>> SessionPriceSimpleQuery(Expression<Func<Venues, Fields, bool>> expressionable, string display);
        #endregion
    }
}
